package com.swh.tetris;

import java.awt.Color;
import java.util.Random;

public class ShapeFactory {
	public ShapeFactory() {}
	public static int[][][] SHAPES={
			{
				{0,1,0,0},
				{0,1,0,0},
				{0,1,0,0},
				{0,1,0,0}
			},
			{
				{0,1,0,0},
				{0,1,0,0},
				{0,1,1,0},
				{0,0,0,0}
			},
			{
				{0,0,1,0},
				{0,0,1,0},
				{0,1,1,0},
				{0,0,0,0}
			},
			{
				{0,0,0,0},
				{0,1,1,0},
				{0,1,1,0},
				{0,0,0,0}
			},
			{
				{0,0,0,0},
				{0,1,0,0},
				{1,1,1,0},
				{0,0,0,0}
			},
			{
				{0,1,0,0},
				{0,1,1,0},
				{0,0,1,0},
				{0,0,0,0}
			},
			{
				{0,0,1,0},
				{0,1,1,0},
				{0,1,0,0},
				{0,0,0,0}
			}
	};
	
	public static Color[] COLORS={
		new Color(0xCC0033),
		new Color(0x0099CC),
		new Color(0xFF6600),
		new Color(0x33CC33),
		new Color(0x006600),
		new Color(0x990099),
		new Color(0x663300)
	};
	
	public static Shape createShape(){
		Random r=new Random();
		int index=r.nextInt(7);
		Shape shape=new Shape(SHAPES[index],COLORS[index]);
		return shape;
	}
}
